package spider.util;

import spider.NovelSiteEnum;
import spider.impl.novel.BxwxNovleSpider;
import spider.impl.novel.KanShuZhongNovelSpider;
import spider.interfaces.INovelSpider;

/**
 * 生产书籍列表的实现类
 * created by yb
 * on 2017/8/14.
 **/
public final class NovelSpiderFactory {
    private NovelSpiderFactory() {
    }

    /**
     * @param url 爬取小说列表
     * @return  
     */
    public static INovelSpider getNovelSpider( String url ) {
        NovelSiteEnum novelSiteEnum = NovelSiteEnum.getNovelSiteEnumByUrl( url );
        switch ( novelSiteEnum ) {
            case KanShuZhong:
                return new KanShuZhongNovelSpider();
            case BiXiaWenXue:
                return new BxwxNovleSpider();
            default:
                throw new RuntimeException( url + "暂时不被支持" );
        }
    }
}
